using System;
using Unity.Extensions;
using Xunit;

namespace Unity.Extensions
{
    public class ErrorsVirtualInterceptorTest
    {
        [Fact]
        public void CannotInterceptNonPublicClass()
        {
            Assert.Throws<TypeLoadException>(
                () => VirtualInterceptor.WrapClass(typeof(PrivateClass)));
        }

        [Fact]
        public void CannotInterceptSealedClass()
        {
            Assert.Throws<TypeLoadException>(
                () => VirtualInterceptor.WrapClass(typeof(SealedClass)));
        }

        public sealed class SealedClass {}

        class PrivateClass {}
    }
}